<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
	
	/**
	 * Initialize the application autoload
	 *
	 * @return Zend_Application_Module_Autoloader
	 */
	protected function _initAppAutoload() {
		$autoloader = new Zend_Application_Module_Autoloader ( array ('namespace' => 'App', 'basePath' => dirname ( __FILE__ ) ) );
		$autoloader->autoload ( 'GuestUser.php' );
		return $autoloader;
	}
	
	/**
	 * Initialize the layout loader
	 */
	protected function _initLayoutHelper() {
		$this->bootstrap ( 'frontController' );
		$layout = Zend_Controller_Action_HelperBroker::addHelper ( new Amz_Controller_Action_Helper_LayoutLoader () );
	}
	
	protected function _initPlugins() {
		//$this->bootstrap ( 'FrontController' );
	//$front = $this->getResource ( 'FrontController' );
	

	/** 
	 * Register plugins
	 * The alternative way is that put plugin to /application/config/application.ini:
	 * resources.frontController.plugins.pluginName = "Plugin_Class"
	 */
	//$front->registerPlugin(new MyAcl_Plugin_IdentityLoader())
	//		->registerPlugin(new MyAcl_Plugin_AccessCheck());
	}
	/**
	 * Loads specified model from module's "models" directory
	 * 
	 * @param   string  $class  Model classname
	 * @param   string  $module Module name. By default, current module is assumed
	 * @throws  Zend_Exception  In case model class not found exception would be thrown
	 * @return  string Class name loaded
	 */
	public function _initModel($module = null) {
		// $modelDir = 'models';
	/*
         $this->getFrontController()->getModuleDirectory($module)
                       . DIRECTORY_SEPARATOR . 'models'
                       
         */
	// Zend_Loader::loadClass($class, $modelDir);
	

	// if we got here - then file is included
	

	}
	public function _initLoad() {
		$autoloader = Zend_Loader_Autoloader::getInstance ();
		$autoloader->registerNamespace ( 'Application_' );
		return $autoloader;
	}
	
	protected function _initdb() {
		$db = Zend_Db::factory ( 'Pdo_Mysql', array ('host' => 'localhost', 'username' => 'root', 'password' => '', 'dbname' => 'test' ) );
		return $db;
	}

}